import PropTypes from 'prop-types'
import React,{ memo }  from 'react';
import { FooterWrapper } from '@/components/section-footer/style'
import { useNavigate } from 'react-router-dom'
import IconMoreArrow from '@/assets/svg/icon-more-arrow'

const SectionFooter = memo((props) => {

  const {name} = props;
  let showMessage= '显示全部';
  if(name){
    showMessage =`显示更多${name}房源！`
  }
  // 路由跳转
  const navigate = useNavigate()
  function moreClickHandle(){
    navigate('/entire')
  }
  return (
    <FooterWrapper>
      <div className="info" onClick={moreClickHandle}>
        <span className="text">{showMessage}</span>
        <IconMoreArrow/>
      </div>
    </FooterWrapper>
  );
});
SectionFooter.propTypes = {
  name:PropTypes.string,
}
export default SectionFooter;


